package main

import "net/http"

func main() {

}

func base() {

	//自定义配置
	server := http.Server{
		Addr:         ":8080",
		Handler:      nil,
		ReadTimeout:  1000,
		WriteTimeout: 2000,
	}
	server.ListenAndServe()

	//或者
	//第二个参数跟 handler
	//http.HandleFunc("/",myHandle)
	http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
		//匿名函数处理请求
	})
	http.ListenAndServe("addr", nil)

}
func myHandle(writer http.ResponseWriter, r *http.Request) {
	//匿名函数处理请求

	writer.Write([]byte("hello"))
}
